<?php

class Application_Model_Nachrichten
{
	protected $_id;
	protected $_empfanger;
	protected $_absender;
	protected $_titel;
	protected $_text;
	protected $_read;
	protected $_system;
	protected $_delete;
	
	public function __construct (array $options = null)
	{
		if (is_array($options))
		{
			$this->setOptions($options);
		}
	}
	public function setOptions (array $options)
	{
		$methods = get_class_methods($this);
		foreach ($options as $key => $value)
		{
			$method = 'set' . ucfirst($key);
			if (in_array($method, $methods))
			{
				$this->$method($value);
			}
		}
		return $this;
	}

	public function __set ($name, $value)
	{
		$method = 'set' . ucfirst($name);
		if (('mapper' == $name) || ! method_exists($this, $method))
		{
			throw new Exception('Invalid auth property');
		}
		$this->$method($value);
	}
	
	public function __get ($name)
	{
		$method = 'get' . ucfirst($name);
		if (('mapper' == $name) || ! method_exists($this, $method))
		{
			throw new Exception('Invalid auth property');
		}
		return $this->$method();
	}
	public function getId() {
		return $this->_id;
	}

	public function getEmpfanger() {
		return $this->_empfanger;
	}

	public function getAbsender() {
		return $this->_absender;
	}

	public function getText() {
		return $this->_text;
	}

	public function setId($_id) {
		$this->_id = $_id;
	}

	public function setEmpfanger($_empfanger) {
		$this->_empfanger = $_empfanger;
	}

	public function setAbsender($_absender) {
		$this->_absender = $_absender;
	}

	public function setText($_text) {
		$this->_text = $_text;
	}
	public function getRead() {
		return $this->_status;
	}

	public function setRead($_read) {
		$this->_read = $_read;
	}
	public function getDelete() {
		return $this->_delete;
	}

	public function setDelete($_delete) {
		$this->_delete = $_delete;
	}
	public function getTitel() {
		return $this->_titel;
	}

	public function setTitel($_titel) {
		$this->_titel = $_titel;
	}
	public function getSystem() {
		return $this->_system;
	}

	public function setSystem($_system) {
		$this->_system = $_system;
	}

}